<?php
/**
 * @link https://www.kancloud.cn/cleverstone/ymb2
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

/* ====== 卡片构建器 Web Javascript ====== */

/* @var \yii\web\View $this */
/** @var \builder\card\CardBuilder $context 卡片构建器实例 */
/** @var array $extraJs 额外的JS脚本 */

// 上下文对象
$context = $this->context;
?>

<script>
    +function (global, top) { "use strict";
        global.ym2App.controller("ym2.ctrl.<?= $context->id ?>", [ "$scope", function ($scope) {
            //渲染额外的JS脚本
            <?= !empty($extraJs) ? implode("\n", $extraJs) : '' ?>

        }]);
    }(window, top);
</script>